package com.gregbugaj.nscaffold.node;

import com.gregbugaj.nscaffold.generator.Visitable;
import com.gregbugaj.nscaffold.generator.Visitor;
import com.gregbugaj.nscaffold.type.PType;


/**
 * Property class describing individual column 
 * @author gbugaj
 *
 */
public class PropertyInfo implements Visitable{
	private PClass parent;
	private String propertyName;
	private Class<?> propertyClass;
	private boolean isCollection;
	
	
	private PType type;
	
	public boolean isCollection() {		
		return isCollection;
	}
	
	
	public String getPropertyName() {
		return propertyName;
	}

	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}


	public PType getType() {
		return type;
	}

	public void setType(PType type) {
		this.type = type;
	}


	public PClass getParent() {
		return parent;
	}


	public void setParent(PClass parent) {
		this.parent = parent;
	}
	
	@Override
	public String toString() {
	
		return "["+propertyName+" type="+type+"]";
	}


	public void setCollection(boolean isCollection) {
		this.isCollection = isCollection;
	}


	@Override
	public void accept(Visitor visitor) {
		visitor.visit(this);		
	}




	public Class<?> getPropertyClass() {
		return propertyClass;
	}


	public void setPropertyClass(Class<?> propertyClass) {
		this.propertyClass = propertyClass;
	}



}
